<template>
  <view class="normal-login-container login-bg">
    <view
      class="logo-content align-center justify-center flex"
      style="padding-top: 46%"
    >
      <image
        style="width: 150rpx; height: 150rpx"
        :src="globalConfig.appInfo.logo"
        mode="widthFix"
      >
      </image>
    </view>
    <view class="logo-content align-center justify-center flex">
      <text class="title bjimg">数字全息巡护终端</text>
    </view>
    <view class="login-form-content">
      <view class="input-item flex align-center">
        <view class="iconfont icon-user icon"></view>
        <input
          v-model="users.username"
          class="input"
          type="text"
          placeholder="请输入账号"
          maxlength="30"
        />
      </view>
      <view class="input-item flex align-center">
        <view class="iconfont icon-password icon"></view>
        <input
          v-model="users.password"
          type="password"
          class="input"
          placeholder="请输入密码"
          maxlength="20"
        />
      </view>
      <!--  <view class="flex paddingOne">
				<u-radio-group v-model="users.agree">
					<u-radio  shape="square" labelColor="#eee" label="记住密码"></u-radio>
				</u-radio-group>
			</view> -->
      <!-- <view class="input-item flex align-center" v-if="captchaEnabled">
				<view class="iconfont icon-code icon"></view>
				<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
				<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
			</view> -->
      <view class="action-btn">
        <button
          @click="handleLogin"
          class="login-btn cu-btn block bg-blue lg round"
        >
          登录
        </button>
      </view>
    </view>
  </view>
</template>

<script>
// import { Base64 } from 'js-base64'
// let uft8Str = utf8.encode("Fmks@yjt2022");
export default {
  data() {
    return {
      // value: "false",
      codeUrl: "",
      captchaEnabled: true,
      globalConfig: getApp().globalData.config,
      users: {
        username: "fm", 
        password: "Fmks@yjt2022", 
        clientId: "APP",
        platformCode: "nonCoalMine",
      },
    };
  },
  created() {},
  methods: {
    // 登录方法
    async handleLogin() {
      if (this.users.mobile === "") {
        this.$modal.msgError("请输入您的账号");
      } else if (this.users.code === "") {
        this.$modal.msgError("请输入您的密码");
      } else {
        this.$modal.loading("登录中，请耐心等待...");
        this.pwdLogin();
      }
    },
	
	async pwdLogin(){
		this.$tab.reLaunch("/pages/index");
		
	}
	
	
	
    // 密码登录
  //   async pwdLogin() {
		
		// this.$tab.reLaunch("/pages/index");
  //     this.$store
  //       .dispatch("Login", this.users)
  //       .then(() => {
  //         this.$modal.msgError("登录成功");
  //         this.$tab.reLaunch("/pages/index");
  //         //	this.loginSuccess()
  //       })
  //       .catch((error) => {});
  //   },
  //   登录成功后，处理函数
  //   loginSuccess(result) {
  //     // 设置用户信息
  //     this.$store.dispatch("GetInfo").then((res) => {
  //       this.$tab.reLaunch("/pages/index");
  //     });
  //   },
  },
};
</script>

<style lang="scss" scoped>
page {
  background-color: #ffffff;
}

.normal-login-container {
  width: 100%;

  .logo-content {
    width: 100%;
    font-size: 25px;
    text-align: center;
    padding-top: 5%;

    text {
      color: #fff;
      font-size: 16px;
      letter-spacing: 7px;
      line-height: 25px;
    }

    image {
      border-radius: 4px;
    }

    .title {
      margin-left: 10px;
    }
  }

  .login-form-content {
    text-align: center;
    margin: 20px auto;
    margin-top: 15%;
    width: 80%;

    .input-item {
      margin: px auto;

      height: 45px;

      border-bottom: 1px solid #727984;

      .icon {
        font-size: 38rpx;
        margin-left: 10px;
        color: #fff;
      }

      .input {
        width: 100%;
        font-size: 14px;
        line-height: 20px;
        text-align: left;
        padding-left: 15px;
        color: #eee;
      }
    }

    .login-btn {
      margin-top: 40px;
      height: 45px;
      border: 4px solid #c4d4e1;
      border-bottom: 4px solid rgba(196, 215, 231, 0.44);
    }

    .xieyi {
      color: #333;
      margin-top: 20px;
    }
  }

  .easyinput {
    width: 100%;
  }
}

.login-code-img {
  height: 45px;
}

.login-bg {
  height: 100vh;
  background-image: url(../static/logobj2.0.png);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.bg-blue {
  background-color: #ffffff;
  color: #066a89;
}

.uni-input-input {
  position: relative;
  display: block;
  height: 100%;
  background: none;
  color: #eee;
  opacity: 1;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-indent: inherit;
  text-transform: inherit;
  text-shadow: inherit;
}

.bjimg {
  width: 206px;
  height: 24px;
  background: linear-gradient(
    37deg,
    rgba(24, 95, 154, 0) 0%,
    #185f9a 54%,
    rgba(24, 95, 154, 0) 100%
  );
}

.cu-btn.lg {
  padding: 0 20px;
  font-size: 18px;
  font-weight: bold;
  height: 41px;
}

.paddingOne {
  padding: 10px;
}
</style>
